home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.1 / lca.1 < prev    next >
Text File  |  1995-07-25  |  4KB  |  66 lines

  1.    lca: generate linear cellular automata.
  2.    Usage: lca [options]
  3.    This program calculates and displays succeeding generations of linear
  4. cellular automata.  LCA are related to the Game of Life, but are one- rather
  5. than two-dimensional.  Also, while in the Game of Life each cell is in one
  6. of two states (alive or dead), LCA may have many states, and in this
  7. implementation the number of states is not fixed.
  8.    The state of each cell is refered to as its value.  Each cell has a value
  9. between zero and one less than the number of possible states.  To find the
  10. value of the cell in the next generation, its current value and the current
  11. values of the cells on either side are added together.  The result is used
  12. to select a "rule".  There is one rule for each possible result.  Thus, if
  13. each cell has four possible values (0-3), the sum of the three cells will be
  14. between 0 and 9, and there will be ten rules.  Each rule is a value which
  15. will be the new value of the cell.  For example, if the values of a cell,
  16. its left neighbor, and it right neighbor are 2, 0, and 3, and the value of
  17. rule 5 is 1, then the value of the cell in the next generation will be 1.
  18. The cells are arranged in a circular configuration; that is, the leftmost
  19. and rightmost cells are taken to be neighbors.
  20.    To display the cells, a unique character is associated with each value,
  21. and the character associated with a particular value is what is printed to
  22. represent a cell of that value.  Thus, the cells are displayed in the form
  23. of a string of characters.  The number of cells is typically chosen to be
  24. one less than the width of the display device that will be used, for
  25. convenience in display and to avoid problems with line wrap.  Succeeding
  26. generations of cells will be printed on succeeding lines.  The two-
  27. dimentional, ongoing pattern produced by succeeding generations of cells can
  28. be extremely interesting.
  29.    The following arguments are used to determine the nature of the LCA:
  30.    -a<associated chars> : a is followed by a string of chars.  The leftmost
  31. char should be the character to be associated with value (state) 0; the next
  32. char should be the character to be associated with value 1, etc.  The total
  33. number of chars will determine the number of possible states.  If -a is not
  34. given, the associated char string defaults to " .+X".
  35.    -r<rules> : r is followed by a series of integers separated by commas.
  36. The leftmost number should be the value of rule 0; the next, the value of
  37. rule 1, etc.  The number of rules given should be (1 + 3 * [highest possible
  38. value of a cell, as determined by the -a argument]), since there must be one
  39. rule for each possible value of the sum of the three cells.  For example, if
  40. four chars are given with the -a argument, then the possible values of a
  41. cell are 0 - 3, and there should be 10 rules given with the -r argument (one
  42. for each of the possible sums 0 - 9).  If there are not enough rules, the
  43. highest rules will be set to 0.
  44.    -c<char rules> : The rules may be specified by giving string of
  45. characters instead of integers.  Each character will be looked up in the
  46. string given in the -a argument to find its value.
  47.    If neither -r nor -c is given, the rules are initialized to random values.
  48.    -w<width> : width should be an integer specifying the number of cells.
  49. The default is 79.
  50.    -i<init string> : The initial values of the cells can be given as a
  51. string of characters which are translated to values in the same manner as
  52. the characters given in the -c argument are.  If not enough characters are
  53. given, the rightmost cells will be set to 0.  If this argument is not given,
  54. the cells are initialized randomly.
  55.    -g<generations> : The number of generations to produce (and thus lines to
  56. print).  If this argument is not given, the program will continue until halted.
  57.    -m<mutation period> : <mutation period> should be an integer.  The rules
  58. will be replaced with a new random set each time that the specified period
  59. (number of generations) has elapsed.  The default is 25.  If 0 is specified,
  60. no mutations will occur.  Each time a mutation occurs, the cells are checked
  61. to determine whether they are all identical.  If they are, the value of the
  62. middle cell is changed to <maxcellvalue> and the value of the cell to the
  63. right of the middle cell is changed to <maxcellvalue> - 1, in order to begin
  64. an interesting sequence again.  The terminal will beep when this occurs.
  65.    Author: John DuBois (john@armory.com)
  66.